﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

namespace RpgLibrary.SpriteClasses
{
    public class AnimationData
    {
        #region Field Region
        
        public Rectangle[] Frames;
        public int FramesPerSecond;
        
        #endregion

        #region Property Region
        
        public string Name
        {
            get
            {
                return "Animation"; 
            }
            set
            {

            }
        }
        #endregion

        #region Constructor Region

        public AnimationData(int frameCount, int frameWidth, int frameHeight, int xOffset, int yOffset)
        {
            Frames = new Rectangle[frameCount];
            
            for (int i = 0; i < frameCount; i++)
            {
                Frames[i] = new Rectangle(
                    xOffset + (frameWidth * i),
                    yOffset,
                    frameWidth,
                    frameHeight);
            }

            FramesPerSecond = 5;
        }

        public AnimationData(Rectangle[] frames)
        {
            Frames = frames;
            FramesPerSecond = 5;
        }

        private AnimationData()
        {
        }

        #endregion

        #region Method Region
        
        #endregion

        #region Interface Method Region
        
        public object Clone()
        {
            AnimationData data = new AnimationData();
            data.Frames = this.Frames;
            data.FramesPerSecond = this.FramesPerSecond;

            return data;
        }
        #endregion
    }
}
